package com.cfw.util;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class SpringUtil {
	
	public static Object getBean(String beanName) {
		HttpServletRequest request = HttpUtil.getCurrentRequest();
		WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext( request.getSession().getServletContext());
		
	    return wac.getBean(beanName);
	}
	
}
